package com.jhgk.jhcee.common.enums;

/**
 * @author: xiezhongping
 * @description:
 * @date: 2021/8/6 10:11.
 */

public enum BasisResultEnum implements BasisResultTemplate {
    SUCCESS(0, "操作成功", "success"),
    UPDATE_SUCCESS(0, "更新成功", "success"),
    SUCCESSFUL(0, "ok", "success"),
    PARAM_IS_NULL(1, "参数为空", "fail"),
    QUERY_IS_NULL(1, "查询为空", "fail"),
    DELETE_FAIL(1, "删除失败", "fail"),
    UNAUTHORIZED(401, "暂未登录或token已经过期", "unauthorized"),
    FORBIDDEN(403, "没有相关权限", "forbidden"),
    FAIL(1, "操作失败", "fail"),
    ADD_FAIL(1,"新增失败","fail"),
    USER_VALID(1,"用户已存在","message"),
    SAVE_ROLE_RELATION_FAIL(1,"保存用户角色信息失败","fail"),
    USER_NOT_EXIST(1, "用户不存在", "fail");

    private long code;

    private String message;

    private String type;

    BasisResultEnum(long code, String message, String type) {
        this.code = code;
        this.message = message;
        this.type = type;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getType() {
        return type;
    }
}
